Senior Software Engineer, JBoss Developer Experience, Red Hat
Contributor to
JBoss Forge - Scaffolding and others
JBoss Developer experience materials
Maintainer of TicketMonster
Notes
I’m Vineet, and I work as an engineer for JBoss at Red Hat
I work primarily in the JBoss Developer experience team.
Primarily on JBoss Forge and JBoss Developer Framework to make it easier for developers to get started with Java EE development.
Objectives
Discover JBoss Forge. Learn how to extend it for your needs.
Notes
This is a talk focussed on showcasing JBoss Forge to newbies, and help them discover features in JBoss Forge.
Eventually, they will learn on extending JBoss Forge to build in capabilities that would suit their needs.
This talk is for you if you’re a beginner and you want a tool that helps you make fewer mistakes.
The contents of the talk also apply if you’re a pro and you want a tool that automates away the trivial bits.
The talk is relevant even if you have unique needs, and also when your company or customers have unique needs.
Let’s talk about productivity
Every one wants development to be simple.Notes
People walk away from complex and bloated programming models.
Does EJB 2 ring a bell ? What about JSF 1.x ?
In contrast, you have Ruby on Rails, Django, or even micro-frameworks like Flask and Sinatra.
And you now have people clamouring to use NodeJS because it allows you to share logic between the client and the server.
Some expect to learn one language, a few APIs, maybe one framework, and meet all demands with a limited set of primitives.Notes
In most of the previous examples, simplicity came at a price.
The frameworks work best in a set of scenarios, namely in web-app development, but not for everything.
But in reality - One language is hardly sufficient. APIs are numerous. Frameworks are dime a dozen.Notes
These is a context in which you use the languages, APIs and frameworks.
Different contexts require different solutions.
You wouldn’t really want to write your execution engines for enterprise apps in JavaScript today.
Nor would you want to write business rules in a programming language.
And it takes time to discover best practices relevant to your development stack.Notes
Learning these takes time.
Discovering how to use them effectively takes even more time.
Achieving expertise is not easy. It takes time.Notes
If you look at the Dreyfus model of skill acquisition, most people start off as novices.
They learn the rules on how to use their toolkits. But they may not know when to apply them.
Eventually they begin to gain contextual knowledge on when to apply the rules.
And finally, they formulate new rules as they mature to become experts in their domains.
Scaling expertise across teams is even tougher.Notes
Scaling the Dreyfus model across to teams and organizations takes even more time.
You need competent people to pass on their knowledge to the less fortunate ones.
Self-discovery takes time.
Self-discovery without automation to aid in gaining competence takes time.
Speaking of Forge…
Aids in automation of repetitive tasks.
Performs generation of boilerplate code.
Helps you focus on business-centric activities.
Available as an Eclipse plugin and a CLI tool.
for now…
Notes
Through the automation of repetitive tasks, Forge helps you focus on the activities that matter to your business.
You don’t have to waste time to figure out what snippets of code really matter in using a particular feature of some framework or library.
Mundane tasks prone to errors can be abstracted away.
Forge does not constrain you to a particular language or runtime, even though it is written in Java and ships with several commands hugely relevant to Java EE.
Forge is available in various form factors to help different audiences - a CLI tool for command-line junkies and an Eclipse plugin for heavy-IDE users.
These commands are contextual as well. Try running scaffold-setup without running the previous ones.
Forge commands can be made to operate on the state of the project without making assumptions.
Scaffold an applicationNotes
$ scaffold-setup --provider Faces
We already ran this, but you should be aware that scaffolding is a very powerful command.
In Forge, scaffolding can be considered as a composite command.
It can compose several individually meaningful commands into a composite operation whose end-result is even more meaningful.
Of course, you could write scaffold providers without employing these principles ;-)
Note that you can write your own scaffold providers.
Looking back…
Forge commands can consume the output of others
Goes beyond offerings from Maven archetypes etc.
Forge is not constrained to any framework.
Very much unlike tools tied to frameworks.
Notes
Unlike Maven archetypes that offer limited producivity gains in project bootstrapping, Forge goes beyond just setting up the project.
While it is easier to create a new project with facets in Forge, it is even easier to perform developer-facing tasks.
None of the APIs in Forge will force you to operate on some premise. Even if they do for valid reason, (say, work with Java source files), you can write your own and plug into the modular runtime employed by Forge.
This is unlike other tooling. If you’re a framework author, you can build tooling around your framework using Forge.
Looking back…
It offers productivity to beginners and experts alike.
Caters to IDE and command-line users.
It provides 'sugar' at a higher level than language constructs.
Productivity is not limited by requiring you to be aware of "syntactic sugar".
"I need a persistence layer" vs "I need to declare a property"
Notes
Skills levels dont really matter when you want to get more productive.
You may think that switching to languages with more concise syntax will make your productive by cutting down on typing.
Forge can help you even more, by making operations themselves more concise, so you gain more productivity combining contextual operations with concise syntax.
For example, you’ve already seen how Forge manages properties and relations in JPA entities. No longer do you need to create a field, it’s getter and an optional setter. Forge understands properties in the context of JPA and how to manage them.
Before we extend Forge, let’s understand it.Notes
Forge use the Furance runtime to manage addons.
Furnace is closely linked to the JBoss Modules project, offering a modular classloading environement.
Capabilities can be added by deploying new addons.
Want a new scaffold provider? Deploy a new addon.
Want support for a new language? Deploy another addon.
Engineer your workflow. Write your own addons
Recap
JBoss Forge :
can automate common development tasks
allows you to extend it’s behavior
with a simple programming model
without constraining you to a specific environment